package com.situ.hotel.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.situ.hotel.entity.Result;
import com.situ.hotel.util.UploadUtil;
@RestController
public class UploadController {
	
    @Value("${upload.path}")
	private String path;
    
    
	@PostMapping("/upload")
	public Result upload(MultipartFile file) {
	   String filename = UploadUtil.save(file, path);
	   return Result.success(0, filename);
	}
}
